﻿//
// Copyright (C) Canyala Innovation AB 2011
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Canyala.Lagoon.Presentation
{
    public class ViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        internal readonly ViewModel Parent;
        protected readonly dynamic State;

        public ViewModel() 
            { State = new PropertyManager(this); }

        public ViewModel(ViewModel parent) : this() 
            { Parent = parent; }

        public void NotifyChanged(string propertyName) 
            { 
                if (PropertyChanged != null) 
                    PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 
            }
    }
}
